namespace GeoWeb.Demo.ButtonConfigInfo
{
    using System;
    using GeoWeb.DataContext;


    /// <summary>
    /// 表名：GeoButtonInfo 主键列：
    /// </summary>
    [SerializableAttribute()]
    public partial class GeoButtonInfo : Entity
    {

        protected Int32 _ID;

        protected String _ButtonHTML;

        protected String _NodesID;

        protected String _Description;

        protected String _Name;

        protected String _JavaScript;

        protected Int32? _GroupType;

        protected Int32? _OrderByGroup;

        protected String _GroupName;

        protected Int32? _GroupOrder;

        protected Guid? _ButtonID;

        public Int32 ID
        {
            get
            {
                return this._ID;
            }
            set
            {
                this.OnPropertyValueChange(_.ID, _ID, value);
                this._ID = value;
            }
        }

        public String ButtonHTML
        {
            get
            {
                return this._ButtonHTML;
            }
            set
            {
                this.OnPropertyValueChange(_.ButtonHTML, _ButtonHTML, value);
                this._ButtonHTML = value;
            }
        }

        public String NodesID
        {
            get
            {
                return this._NodesID;
            }
            set
            {
                this.OnPropertyValueChange(_.NodesID, _NodesID, value);
                this._NodesID = value;
            }
        }

        public String Description
        {
            get
            {
                return this._Description;
            }
            set
            {
                this.OnPropertyValueChange(_.Description, _Description, value);
                this._Description = value;
            }
        }

        public String Name
        {
            get
            {
                return this._Name;
            }
            set
            {
                this.OnPropertyValueChange(_.Name, _Name, value);
                this._Name = value;
            }
        }

        public String JavaScript
        {
            get
            {
                return this._JavaScript;
            }
            set
            {
                this.OnPropertyValueChange(_.JavaScript, _JavaScript, value);
                this._JavaScript = value;
            }
        }

        public Int32? GroupType
        {
            get
            {
                return this._GroupType;
            }
            set
            {
                this.OnPropertyValueChange(_.GroupType, _GroupType, value);
                this._GroupType = value;
            }
        }

        public Int32? OrderByGroup
        {
            get
            {
                return this._OrderByGroup;
            }
            set
            {
                this.OnPropertyValueChange(_.OrderByGroup, _OrderByGroup, value);
                this._OrderByGroup = value;
            }
        }

        public String GroupName
        {
            get
            {
                return this._GroupName;
            }
            set
            {
                this.OnPropertyValueChange(_.GroupName, _GroupName, value);
                this._GroupName = value;
            }
        }

        public Int32? GroupOrder
        {
            get
            {
                return this._GroupOrder;
            }
            set
            {
                this.OnPropertyValueChange(_.GroupOrder, _GroupOrder, value);
                this._GroupOrder = value;
            }
        }

        public Guid? ButtonID
        {
            get
            {
                return this._ButtonID;
            }
            set
            {
                this.OnPropertyValueChange(_.ButtonID, _ButtonID, value);
                this._ButtonID = value;
            }
        }

        /// <summary>
        /// 获取实体对应的表名
        /// </summary>
        protected override Table GetTable()
        {
            return new Table<GeoButtonInfo>("GeoButtonInfo");
        }

        /// <summary>
        /// 获取列信息
        /// </summary>
        protected override Field[] GetFields()
        {
            return new Field[] {
                        _.ID,
                        _.ButtonHTML,
                        _.NodesID,
                        _.Description,
                        _.Name,
                        _.JavaScript,
                        _.GroupType,
                        _.OrderByGroup,
                        _.GroupName,
                        _.GroupOrder,
                        _.ButtonID};
        }

        /// <summary>
        /// 获取列数据
        /// </summary>
        protected override object[] GetValues()
        {
            return new object[] {
                        this._ID,
                        this._ButtonHTML,
                        this._NodesID,
                        this._Description,
                        this._Name,
                        this._JavaScript,
                        this._GroupType,
                        this._OrderByGroup,
                        this._GroupName,
                        this._GroupOrder,
                        this._ButtonID};
        }

        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        protected override void SetValues(IRowReader reader)
        {
            if ((false == reader.IsDBNull(_.ID)))
            {
                this._ID = reader.GetInt32(_.ID);
            }
            if ((false == reader.IsDBNull(_.ButtonHTML)))
            {
                this._ButtonHTML = reader.GetString(_.ButtonHTML);
            }
            if ((false == reader.IsDBNull(_.NodesID)))
            {
                this._NodesID = reader.GetString(_.NodesID);
            }
            if ((false == reader.IsDBNull(_.Description)))
            {
                this._Description = reader.GetString(_.Description);
            }
            if ((false == reader.IsDBNull(_.Name)))
            {
                this._Name = reader.GetString(_.Name);
            }
            if ((false == reader.IsDBNull(_.JavaScript)))
            {
                this._JavaScript = reader.GetString(_.JavaScript);
            }
            if ((false == reader.IsDBNull(_.GroupType)))
            {
                this._GroupType = reader.GetInt32(_.GroupType);
            }
            if ((false == reader.IsDBNull(_.OrderByGroup)))
            {
                this._OrderByGroup = reader.GetInt32(_.OrderByGroup);
            }
            if ((false == reader.IsDBNull(_.GroupName)))
            {
                this._GroupName = reader.GetString(_.GroupName);
            }
            if ((false == reader.IsDBNull(_.GroupOrder)))
            {
                this._GroupOrder = reader.GetInt32(_.GroupOrder);
            }
            if ((false == reader.IsDBNull(_.ButtonID)))
            {
                this._ButtonID = reader.GetGuid(_.ButtonID);
            }
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            if ((obj == null))
            {
                return false;
            }
            if ((false == typeof(GeoButtonInfo).IsAssignableFrom(obj.GetType())))
            {
                return false;
            }
            if ((((object)(this)) == ((object)(obj))))
            {
                return true;
            }
            return false;
        }

        public class _
        {

            /// <summary>
            /// 表示选择所有列，与*等同
            /// </summary>
            public static AllField All = new AllField<GeoButtonInfo>();

            /// <summary>
            /// 字段名：ID - 数据类型：Int32
            /// </summary>
            public static Field ID = new Field<GeoButtonInfo>("ID");

            /// <summary>
            /// 字段名：ButtonHTML - 数据类型：String
            /// </summary>
            public static Field ButtonHTML = new Field<GeoButtonInfo>("ButtonHTML");

            /// <summary>
            /// 字段名：NodesID - 数据类型：String
            /// </summary>
            public static Field NodesID = new Field<GeoButtonInfo>("NodesID");

            /// <summary>
            /// 字段名：Description - 数据类型：String
            /// </summary>
            public static Field Description = new Field<GeoButtonInfo>("Description");

            /// <summary>
            /// 字段名：Name - 数据类型：String
            /// </summary>
            public static Field Name = new Field<GeoButtonInfo>("Name");

            /// <summary>
            /// 字段名：JavaScript - 数据类型：String
            /// </summary>
            public static Field JavaScript = new Field<GeoButtonInfo>("JavaScript");

            /// <summary>
            /// 字段名：GroupType - 数据类型：Nullable`1
            /// </summary>
            public static Field GroupType = new Field<GeoButtonInfo>("GroupType");

            /// <summary>
            /// 字段名：OrderByGroup - 数据类型：Nullable`1
            /// </summary>
            public static Field OrderByGroup = new Field<GeoButtonInfo>("OrderByGroup");

            /// <summary>
            /// 字段名：GroupName - 数据类型：String
            /// </summary>
            public static Field GroupName = new Field<GeoButtonInfo>("GroupName");

            /// <summary>
            /// 字段名：GroupOrder - 数据类型：Nullable`1
            /// </summary>
            public static Field GroupOrder = new Field<GeoButtonInfo>("GroupOrder");

            /// <summary>
            /// 字段名：ButtonID - 数据类型：Nullable`1
            /// </summary>
            public static Field ButtonID = new Field<GeoButtonInfo>("ButtonID");
        }
    }
}
